package com.qingcloud.adminbackend.entity.weatherdata;

import cn.hutool.core.util.StrUtil;
import com.qingcloud.adminbackend.entity.equipment.EquipmentWeatherDataDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
public class WeatherDTO implements Serializable {

    @ApiModelProperty(value = "设备编号")
    private String equipmentId;

    @ApiModelProperty(value = "时间")
    private String time;

    @ApiModelProperty(value = "监测点名称")
    private String stationName;

    @ApiModelProperty(value = "监测点Id")
    private String  stationId;

    @ApiModelProperty(value = "监测点详情信息")
    private String stationDetails;

    @ApiModelProperty(value = "监测点区域")
    private String domainDetails;

    @ApiModelProperty(value = "监测点空间详情信息")
    private String moDetails;

    @ApiModelProperty(value = "监测点空间位置")
    private String moAddress;

    @ApiModelProperty(value = "经度")
    private String lng;

    @ApiModelProperty(value = "纬度")
    private String lat;

    @ApiModelProperty(value = "空间Id")
    private String moId;

    @ApiModelProperty(value = "系统业务类型")
    private String workType;

    @ApiModelProperty(value = "地区Id")
    private String domainId;

    @ApiModelProperty(value = "监测因子ids")
    private String factors;

    @ApiModelProperty(value = "监测因子")
    private String factorDetails;

    @ApiModelProperty(value = "业务标识 (1： 企业监测点位；2：个人监测点位)")
    private int businessType;

    @ApiModelProperty(value = "监测数据")
    private EquipmentWeatherDataDTO equipmentBaseDataDTO;

    public String getLng() {
        if (StrUtil.isBlank(lng)) {
            lng = "";
        }
        return lng.indexOf("0.00") > -1 ? "" : lng;
    }

    public String getLat() {
        if (StrUtil.isBlank(lat)) {
            lat = "";
        }
        return lat.indexOf("0.00") > -1 ? "" : lat;
    }
}
